package com.luzhikun.Servlets;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;

public class SomeServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        System.out.println("执行SomeServlet");
        // 获取请求域中所携带的参数名称
        Enumeration<String> attributeNames = request.getAttributeNames();
        // 遍历
        while (attributeNames.hasMoreElements()) {
            String s = attributeNames.nextElement();
            Object attribute = request.getAttribute(s);
            System.out.println(s + "===" + attribute);
        }

        response.setContentType("text/html;charset=UTF-8");
        PrintWriter writer = response.getWriter();
        writer.println("-----------SomeServlet-----------<br>");

    }


}
